﻿using AutoMachine;
using CommonTool;
using Motions;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading;
using System.Threading.Tasks;
using System.Windows.Forms;
using Tool;

namespace Station
{
    public class Init
    {

        #region 工站线程

        private Thread m_thread = (Thread)null;

        //线程是否运行中
        private bool m_bRunThread;

        /// <summary>
        /// 启动线程
        /// </summary>
        public void StartRun()
        {
            //if (this.m_thread != null)
            //{
            //    return;
            //}
            InitStep = 0;
            m_thread = (Thread)null;
            if (this.m_thread == null)
            {
                this.m_thread = new Thread(new ThreadStart(this.Running));
            }

            if (this.m_thread.ThreadState != 0)
            {
                this.m_bRunThread = true;
                this.m_thread.IsBackground = true;
                this.m_thread.Start();
            }

        }

        /// <summary>
        /// 停止线程
        /// </summary>
        public void StopRun()
        {
            Thread.Sleep(50);
            InitStep = 0;
            SystemMgr.GetInstance().WriteSysInt(SysInt.intStep, 0);
            if (this.m_thread == null)
            {
                return;
            }
            this.m_bRunThread = false;
            if (!this.m_thread.Join(5000))
            {
                this.m_thread.Abort();
            }
            this.m_thread = (Thread)null;
        }

        public void Running()
        {
            Device.ChangeStateMode(Device.STATEMode.Resetting);
            while (this.m_bRunThread == true)
            {
                if (Device.StateMode == Device.STATEMode.EMG)
                {
                    break;
                }
                if (Device.StateMode == Device.STATEMode.Resetting)
                {
                    InitWork();
                }
                else
                {
                    Thread.Sleep(5);
                    break;
                }
            }
        }

        #endregion

        #region 流程步

        public int InitStep = 0;

        #endregion


        /// <summary>
        /// 初始化流程
        /// </summary>

        public void InitWork()
        {
            SystemMgr.GetInstance().WriteSysInt(SysInt.intStep, InitStep);
            switch (InitStep)
            {
                case 0:
                    for (SysBit i = 0; i < (SysBit)60; i++)
                    {
                        SystemMgr.GetInstance().WriteSysBit(i, false);
                    }
                  
                   

                    InitStep = 10;             
                    break;
                case 10:

                    MotionMgr.GetInstance().ALLSeverOff();
                    MotionMgr.GetInstance().ResetCmd(1, 2);
                    MotionMgr.GetInstance().ResetCmd(1, 0);
                    MotionMgr.GetInstance().ResetCmd(1, 1);
                    MotionMgr.GetInstance().ResetCmd(1, 5);
                    MotionMgr.GetInstance().ResetCmd(1, 3);
                    MotionMgr.GetInstance().ResetCmd(1, 4);
                    MotionMgr.GetInstance().ResetCmd(2, 1);
                    MotionMgr.GetInstance().ResetCmd(2, 0);
                    MotionMgr.GetInstance().ResetCmd(2, 2);
                    MotionMgr.GetInstance().ResetCmd(2, 3);
                    MotionMgr.GetInstance().ResetCmd(2, 5);
                    MotionMgr.GetInstance().ResetCmd(3, 10);
                    MotionMgr.GetInstance().ResetCmd(3, 0);
                    MotionMgr.GetInstance().ResetCmd(3, 2);
                    MotionMgr.GetInstance().ResetCmd(3, 3);
                    MotionMgr.GetInstance().ResetCmd(3, 5);

                    InitStep = 20;
                    break;
                case 20:
                    #region 真空复位
                    ZK_进料真空吸关();
                    ZK_进料真空破关();
                    ZK_出料真空吸关();
                    ZK_出料真空破关();
                    ZK_平台搬运真空吸关();
                    ZK_平台搬运真空破关();
                    ZK_取料定位真空吸关();
                    ZK_取料定位真空破关();
                    ZK_OK搬运真空吸关();
                    ZK_OK搬运真空破关();
                    ZK_双工位1接料真空1吸关();
                    ZK_双工位1接料真空1破关();
                    ZK_双工位1接料真空2吸关();
                    ZK_双工位1接料真空2破关();
                    ZK_双工位1接料真空3吸关();
                    ZK_双工位1接料真空3破关();
                    ZK_双工位1接料真空4吸关();
                    ZK_双工位1接料真空4破关();
                    ZK_双工位1接料真空5吸关();
                    ZK_双工位1接料真空5破关();
                    ZK_双工位2接料真空1吸关();
                    ZK_双工位2接料真空1破关();
                    ZK_双工位2接料真空2吸关();
                    ZK_双工位2接料真空2破关();
                    ZK_双工位2接料真空3吸关();
                    ZK_双工位2接料真空3破关();
                    ZK_双工位2接料真空4吸关();
                    ZK_双工位2接料真空4破关();
                    ZK_双工位2接料真空5吸关();
                    ZK_双工位2接料真空5破关();
                    ZK_出料口真空1吸关();
                    ZK_出料口真空1破关();
                    ZK_出料口真空2吸关();
                    ZK_出料口真空2破关();
                    #endregion
                    #region 气缸复位
                    QG_上料气缸1原点();
                    QG_上料气缸2原点();
                    QG_出料气缸1原点();
                    QG_出料气缸2原点();
                    QG_夹爪气缸1原点();
                    QG_夹爪气缸2原点();
                    QG_夹爪升降气缸1原点();
                    QG_夹爪升降气缸2原点();
                    QG_进料气缸原点();
                    QG_出料气缸原点();
                    QG_平台搬运气缸原点();
                    QG_取料定位气缸原点();
                    QG_下料上下气缸1原点();
                    QG_下料上下气缸2原点();
                    QG_下料上下气缸3原点();
                    QG_下料上下气缸4原点();
                    QG_下料上下气缸5原点();
                    QG_磁吸升降气缸1原点();
                    QG_磁吸升降气缸2原点();
                    QG_磁吸升降气缸3原点();
                    QG_磁吸升降气缸4原点();
                    QG_磁吸升降气缸5原点();
                    QG_OK搬运升降气缸原点();
                    QG_上料磁吸气缸1原点();
                    QG_上料磁吸气缸2原点();
                    QG_上料磁吸气缸3原点();
                    QG_上料磁吸气缸4原点();
                    QG_上料磁吸气缸5原点();
                    QG_入料口夹紧气缸1原点();
                    QG_入料口平移气缸原点();
                    QG_入料口夹紧气缸2原点();
                    QG_入料口顶升气缸原点();
                    QG_接料定位气缸1原点();
                    QG_接料定位气缸2原点();
                    QG_接料定位气缸3原点();
                    QG_出料口气缸原点();
                    #endregion
                    

                    InitStep = 25;
                    break;

                case 25:
                    {
                        if (MotionMgr.GetInstance().ReadIn("拆分弹夹光电")|| MotionMgr.GetInstance().ReadIn("合并弹夹光电"))
                        {
                            MessageBox.Show("拆分合并处弹夹没有拿走请检查");
                            break;
                        }
                        InitStep = 30;
                    }
                    break;

                case 30:
                    Thread.Sleep(1000);
                    MotionMgr.GetInstance().ALLSeverOn();
                    if (MotionMgr.GetInstance().ReadIn("移栽X轴距离信号"))
                    {
                        MotionMgr.GetInstance().Card.JogMove(26, 30 * SystemCfg.AxisCfg[26].PluseRatio, false);
                        InitStep = 35;
                        break;
                    }
                    InitStep = 40;
                    break;

                case 35:
                    if (!MotionMgr.GetInstance().ReadIn("移栽X轴距离信号"))
                    {
                        MotionMgr.GetInstance().Card.StopAxis(26);//轴停
                        InitStep = 40;
                    }
                    break;
                case 40:

                    MotionMgr.GetInstance().HomeLimt("接料X1轴", 1);
                   
                    MotionMgr.GetInstance().HomeLimt("下料Z轴", 1);
                    MotionMgr.GetInstance().HomeLimt("进料Z轴", 1);
                    MotionMgr.GetInstance().HomeLimt("出料Z轴", 1);
                    MotionMgr.GetInstance().HomeLimt("上料Z轴", 1);
                    MotionMgr.GetInstance().HomeLimt("移栽Z轴", 1);
                    MotionMgr.GetInstance().HomeLimt("磁通量检测Z轴", 1);

                    MotionMgr.GetInstance().WaitLimt("接料X1轴",1);
                    MotionMgr.GetInstance().HomeLimt("接料X2轴", 0);
                    MotionMgr.GetInstance().WaitLimt("接料X2轴",0);
                    MotionMgr.GetInstance().WaitLimt("下料Z轴",1);
                    MotionMgr.GetInstance().WaitLimt("进料Z轴",1);
                    MotionMgr.GetInstance().WaitLimt("出料Z轴",1);
                    MotionMgr.GetInstance().WaitLimt("上料Z轴",1);
                    MotionMgr.GetInstance().WaitLimt("移栽Z轴",1);
                    MotionMgr.GetInstance().WaitLimt("磁通量检测Z轴",1);
                    InitStep = 50;
                    break;
                case 50:
                    MotionMgr.GetInstance().HomeMove("移栽X轴");
                    MotionMgr.GetInstance().WaitHome("移栽X轴");
                    MotionMgr.GetInstance().HomeMove("单工位飞拍");
                    MotionMgr.GetInstance().HomeMove("吸嘴U1");
                    MotionMgr.GetInstance().HomeMove("吸嘴U2");
                    MotionMgr.GetInstance().HomeMove("吸嘴U3");
                    MotionMgr.GetInstance().HomeMove("吸嘴U4");
                    MotionMgr.GetInstance().HomeMove("吸嘴U5");
                    MotionMgr.GetInstance().HomeMove("双工位飞拍1");
                    MotionMgr.GetInstance().HomeMove("双工位飞拍2");
                    MotionMgr.GetInstance().HomeMove("平台搬运X轴");
                    MotionMgr.GetInstance().HomeMove("OK搬运Y轴");
                    MotionMgr.GetInstance().HomeMove("下料X轴");
                    MotionMgr.GetInstance().HomeMove("下料Y轴");
                    MotionMgr.GetInstance().HomeMove("搬运X轴");
                    MotionMgr.GetInstance().HomeMove("取料定位Y轴");
                    MotionMgr.GetInstance().HomeMove("上料Y轴");
                    

                    MotionMgr.GetInstance().WaitHome("单工位飞拍");
                    MotionMgr.GetInstance().WaitHome("吸嘴U1");
                    MotionMgr.GetInstance().WaitHome("吸嘴U2");
                    MotionMgr.GetInstance().WaitHome("吸嘴U3");
                    MotionMgr.GetInstance().WaitHome("吸嘴U4");
                    MotionMgr.GetInstance().WaitHome("吸嘴U5");
                    MotionMgr.GetInstance().WaitHome("双工位飞拍1");
                    MotionMgr.GetInstance().WaitHome("双工位飞拍2");
                    MotionMgr.GetInstance().WaitHome("平台搬运X轴");
                    MotionMgr.GetInstance().WaitHome("OK搬运Y轴");
                    MotionMgr.GetInstance().WaitHome("下料X轴");
                    MotionMgr.GetInstance().WaitHome("下料Y轴");
                    MotionMgr.GetInstance().WaitHome("搬运X轴");
                    MotionMgr.GetInstance().WaitHome("取料定位Y轴");
                    MotionMgr.GetInstance().WaitHome("上料Y轴");
                    MotionMgr.GetInstance().AbsMove("TransitCarry", "取料等待X轴");
                    MotionMgr.GetInstance().AbsMove("FlyFilming2", "双工位飞拍1安全位");
                    MotionMgr.GetInstance().AbsMove("FlyFilming3", "双工位飞拍2安全位");
                    MotionMgr.GetInstance().AbsMove("TransitPickUp", "上料Y轴安全位");
                    MotionMgr.GetInstance().WaitAbs("TransitCarry", "取料等待X轴");
                    MotionMgr.GetInstance().WaitAbs("FlyFilming2", "双工位飞拍1安全位");
                    MotionMgr.GetInstance().WaitAbs("FlyFilming3", "双工位飞拍2安全位");
                    MotionMgr.GetInstance().WaitAbs("TransitPickUp", "上料Y轴安全位");

                    InitStep = 60;
                    break;

                case 60:
                    MotionMgr.GetInstance().HomeMove("下料Z轴");
                    MotionMgr.GetInstance().HomeMove("进料Z轴");
                    MotionMgr.GetInstance().HomeMove("出料Z轴");
                    MotionMgr.GetInstance().HomeMove("取料定位X轴");
                    MotionMgr.GetInstance().HomeMove("上料Z轴");
                    MotionMgr.GetInstance().HomeMove("移栽U轴");
                    MotionMgr.GetInstance().HomeMove("移栽Z轴");
                    MotionMgr.GetInstance().HomeMove("接料X2轴");
                    MotionMgr.GetInstance().HomeMove("磁通量检测Z轴");
                    MotionMgr.GetInstance().HomeMove("接料X1轴");
                    MotionMgr.GetInstance().HomeMove("出料U轴");

                    MotionMgr.GetInstance().WaitHome("下料Z轴");
                    MotionMgr.GetInstance().WaitHome("进料Z轴");
                    MotionMgr.GetInstance().WaitHome("出料Z轴");
                    MotionMgr.GetInstance().WaitHome("取料定位X轴");
                    MotionMgr.GetInstance().WaitHome("上料Z轴");
                    MotionMgr.GetInstance().WaitHome("移栽U轴");
                    MotionMgr.GetInstance().WaitHome("移栽Z轴");
                    MotionMgr.GetInstance().WaitHome("接料X2轴");
                    MotionMgr.GetInstance().WaitHome("磁通量检测Z轴");
                    MotionMgr.GetInstance().WaitHome("接料X1轴");
                    MotionMgr.GetInstance().WaitHome("出料U轴");
                    MotionMgr.GetInstance().AbsMove("OKMagMerge", "合并等待弹夹位");
                    MotionMgr.GetInstance().WaitAbs("OKMagMerge", "合并等待弹夹位");
                    MotionMgr.GetInstance().AbsMove("MagSplit", "拆分等待弹夹位");
                    MotionMgr.GetInstance().WaitAbs("MagSplit", "拆分等待弹夹位");
                    MotionMgr.GetInstance().AbsMove("UpAndDownLoad", "弹夹下料位置2");
                    MotionMgr.GetInstance().WaitAbs("UpAndDownLoad", "弹夹下料位置2");
                    InitStep = 70;
                    break;
                case 70:
                    GlobalVar.CCDTCP.Send("Home");
                    GlobalVar.DataCCD.Clear();
                    SystemMgr.GetInstance().WriteSysBit(SysBit.HpmeOKAll, true);
                    SystemMgr.GetInstance().WriteSysInt(SysInt.intStep, 0);
                    Device.ChangeStateMode(Device.STATEMode.Reseted);
                    InitStep = 0;
                    break;
            }
        }

        #region 气缸动作
        private void QG_上料气缸1原点()
        {
            MotionMgr.GetInstance().WriteOut("上料气缸1动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("上料气缸1原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("上料气缸1动点", false);
            MotionMgr.GetInstance().WaitIn("上料气缸1原点", true);
        }
        private void QG_上料气缸2原点()
        {
            MotionMgr.GetInstance().WriteOut("上料气缸2动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("上料气缸2原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("上料气缸2动点", false);
            MotionMgr.GetInstance().WaitIn("上料气缸2原点", true);
        }
        private void QG_出料气缸1原点()
        {
            MotionMgr.GetInstance().WriteOut("出料气缸1动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("出料气缸1原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("出料气缸1动点", false);
            MotionMgr.GetInstance().WaitIn("出料气缸1原点", true);
        }
        private void QG_出料气缸2原点()
        {
            MotionMgr.GetInstance().WriteOut("出料气缸2动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("出料气缸2原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("出料气缸2动点", false);
            MotionMgr.GetInstance().WaitIn("出料气缸2原点", true);
        }
        private void QG_夹爪气缸1原点()
        {
            MotionMgr.GetInstance().WriteOut("夹爪气缸1动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("夹爪气缸1原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("夹爪气缸1动点", false);
            MotionMgr.GetInstance().WaitIn("夹爪气缸1原点", true);
        }
        private void QG_夹爪气缸2原点()
        {
            MotionMgr.GetInstance().WriteOut("夹爪气缸2动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("夹爪气缸2原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("夹爪气缸2动点", false);
            MotionMgr.GetInstance().WaitIn("夹爪气缸2原点", true);
        }
        private void QG_夹爪升降气缸1原点()
        {
            MotionMgr.GetInstance().WriteOut("夹爪升降气缸1动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("夹爪升降气缸1原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("夹爪升降气缸1动点", false);
            MotionMgr.GetInstance().WaitIn("夹爪升降气缸1原点", true);
        }
        private void QG_夹爪升降气缸2原点()
        {
            MotionMgr.GetInstance().WriteOut("夹爪升降气缸2动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("夹爪升降气缸2原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("夹爪升降气缸2动点", false);
            MotionMgr.GetInstance().WaitIn("夹爪升降气缸2原点", true);
        }
        private void QG_进料气缸原点()
        {
            MotionMgr.GetInstance().WriteOut("进料气缸动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("进料气缸原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("进料气缸动点", false);
            MotionMgr.GetInstance().WaitIn("进料气缸原点", true);
        }
        private void QG_出料气缸原点()
        {
            MotionMgr.GetInstance().WriteOut("出料气缸动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("出料气缸原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("出料气缸动点", false);
            MotionMgr.GetInstance().WaitIn("出料气缸原点", true);
        }
        private void QG_平台搬运气缸原点()
        {
            MotionMgr.GetInstance().WriteOut("平台搬运气缸动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("平台搬运气缸原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("平台搬运气缸动点", false);
            MotionMgr.GetInstance().WaitIn("平台搬运气缸原点", true);
        }
        private void QG_取料定位气缸原点()
        {
            MotionMgr.GetInstance().WriteOut("取料定位气缸动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("取料定位气缸原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("取料定位气缸动点", false);
            MotionMgr.GetInstance().WaitIn("取料定位气缸原点", true);
        }
        private void QG_下料上下气缸1原点()
        {
            MotionMgr.GetInstance().WriteOut("下料上下气缸1动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("下料上下气缸1原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("下料上下气缸1动点", false);
            MotionMgr.GetInstance().WaitIn("下料上下气缸1原点", true);
        }
        private void QG_下料上下气缸2原点()
        {
            MotionMgr.GetInstance().WriteOut("下料上下气缸2动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("下料上下气缸2原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("下料上下气缸2动点", false);
            MotionMgr.GetInstance().WaitIn("下料上下气缸2原点", true);
        }
        private void QG_下料上下气缸3原点()
        {
            MotionMgr.GetInstance().WriteOut("下料上下气缸3动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("下料上下气缸3原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("下料上下气缸3动点", false);
            MotionMgr.GetInstance().WaitIn("下料上下气缸3原点", true);
        }
        private void QG_下料上下气缸4原点()
        {
            MotionMgr.GetInstance().WriteOut("下料上下气缸4动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("下料上下气缸4原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("下料上下气缸4动点", false);
            MotionMgr.GetInstance().WaitIn("下料上下气缸4原点", true);
        }
        private void QG_下料上下气缸5原点()
        {
            MotionMgr.GetInstance().WriteOut("下料上下气缸5动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("下料上下气缸5原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("下料上下气缸5动点", false);
            MotionMgr.GetInstance().WaitIn("下料上下气缸5原点", true);
        }
        private void QG_磁吸升降气缸1原点()
        {
            MotionMgr.GetInstance().WriteOut("磁吸气缸1动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("磁吸气缸1原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("磁吸气缸1动点", false);
            MotionMgr.GetInstance().WaitIn("磁吸气缸1原点", true);
        }
        private void QG_磁吸升降气缸2原点()
        {
            MotionMgr.GetInstance().WriteOut("磁吸气缸2动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("磁吸气缸2原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("磁吸气缸2动点", false);
            MotionMgr.GetInstance().WaitIn("磁吸气缸2原点", true);
        }
        private void QG_磁吸升降气缸3原点()
        {
            MotionMgr.GetInstance().WriteOut("磁吸气缸3动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("磁吸气缸3原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("磁吸气缸3动点", false);
            MotionMgr.GetInstance().WaitIn("磁吸气缸3原点", true);
        }
        private void QG_磁吸升降气缸4原点()
        {
            MotionMgr.GetInstance().WriteOut("磁吸气缸4动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("磁吸气缸4原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("磁吸气缸4动点", false);
            MotionMgr.GetInstance().WaitIn("磁吸气缸4原点", true);
        }
        private void QG_磁吸升降气缸5原点()
        {
            MotionMgr.GetInstance().WriteOut("磁吸气缸5动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("磁吸气缸5原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("磁吸气缸5动点", false);
            MotionMgr.GetInstance().WaitIn("磁吸气缸5原点", true);
        }
        private void QG_OK搬运升降气缸原点()
        {
            MotionMgr.GetInstance().WriteOut("OK搬运气缸动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("OK搬运气缸原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("OK搬运气缸动点", false);
            MotionMgr.GetInstance().WaitIn("OK搬运气缸原点", true);
        }
        private void QG_上料磁吸气缸1原点()
        {
            MotionMgr.GetInstance().WriteOut("上料磁吸气缸1动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("上料磁吸气缸1原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("上料磁吸气缸1动点", false);
            MotionMgr.GetInstance().WaitIn("上料磁吸气缸1原点", true);
        }
        private void QG_上料磁吸气缸2原点()
        {
            MotionMgr.GetInstance().WriteOut("上料磁吸气缸2动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("上料磁吸气缸2原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("上料磁吸气缸2动点", false);
            MotionMgr.GetInstance().WaitIn("上料磁吸气缸2原点", true);
        }
        private void QG_上料磁吸气缸3原点()
        {
            MotionMgr.GetInstance().WriteOut("上料磁吸气缸3动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("上料磁吸气缸3原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("上料磁吸气缸3动点", false);
            MotionMgr.GetInstance().WaitIn("上料磁吸气缸3原点", true);
        }
        private void QG_上料磁吸气缸4原点()
        {
            MotionMgr.GetInstance().WriteOut("上料磁吸气缸4动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("上料磁吸气缸4原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("上料磁吸气缸4动点", false);
            MotionMgr.GetInstance().WaitIn("上料磁吸气缸4原点", true);
        }
        private void QG_上料磁吸气缸5原点()
        {
            MotionMgr.GetInstance().WriteOut("上料磁吸气缸5动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("上料磁吸气缸5原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("上料磁吸气缸5动点", false);
            MotionMgr.GetInstance().WaitIn("上料磁吸气缸5原点", true);
        }
        private void QG_入料口夹紧气缸1原点()
        {
            MotionMgr.GetInstance().WriteOut("入料口夹紧气缸1动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("入料口夹紧气缸1原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("入料口夹紧气缸1动点", false);
            MotionMgr.GetInstance().WaitIn("入料口夹紧气缸1原点", true);
        }
        private void QG_入料口平移气缸原点()
        {
            MotionMgr.GetInstance().WriteOut("入料口平移气缸动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("入料口平移气缸原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("入料口平移气缸动点", false);
            MotionMgr.GetInstance().WaitIn("入料口平移气缸原点", true);
        }
        private void QG_入料口夹紧气缸2原点()
        {
            MotionMgr.GetInstance().WriteOut("入料口夹紧气缸2动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("入料口夹紧气缸2原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("入料口夹紧气缸2动点", false);
            MotionMgr.GetInstance().WaitIn("入料口夹紧气缸2原点", true);
        }
        private void QG_入料口顶升气缸原点()
        {
            MotionMgr.GetInstance().WriteOut("入料口顶升气缸动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("入料口顶升气缸原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("入料口顶升气缸动点", false);
            MotionMgr.GetInstance().WaitIn("入料口顶升气缸原点", true);
        }
        private void QG_接料定位气缸1原点()
        {
            MotionMgr.GetInstance().WriteOut("接料定位气缸1动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("接料定位气缸1原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("接料定位气缸1动点", false);
            MotionMgr.GetInstance().WaitIn("接料定位气缸1原点", true);
        }
        private void QG_接料定位气缸2原点()
        {
            MotionMgr.GetInstance().WriteOut("接料定位气缸2动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("接料定位气缸2原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("接料定位气缸2动点", false);
            MotionMgr.GetInstance().WaitIn("接料定位气缸2原点", true);
        }
        private void QG_接料定位气缸3原点()
        {
            MotionMgr.GetInstance().WriteOut("接料定位气缸3动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("接料定位气缸3原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("接料定位气缸3动点", false);
            MotionMgr.GetInstance().WaitIn("接料定位气缸3原点", true);
        }
        private void QG_出料口气缸原点()
        {
            MotionMgr.GetInstance().WriteOut("出料口气缸动点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("出料口气缸原点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("出料口气缸动点", false);
            MotionMgr.GetInstance().WaitIn("出料口气缸原点", true);
        }


        private void QG_上料气缸1动点()
        {
            MotionMgr.GetInstance().WriteOut("上料气缸1原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("上料气缸1动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("上料气缸1原点", false);
            MotionMgr.GetInstance().WaitIn("上料气缸1动点", true);
        }
        private void QG_上料气缸2动点()
        {
            MotionMgr.GetInstance().WriteOut("上料气缸2原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("上料气缸2动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("上料气缸2原点", false);
            MotionMgr.GetInstance().WaitIn("上料气缸2动点", true);
        }
        private void QG_出料气缸1动点()
        {
            MotionMgr.GetInstance().WriteOut("出料气缸1原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("出料气缸1动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("出料气缸1原点", false);
            MotionMgr.GetInstance().WaitIn("出料气缸1动点", true);
        }
        private void QG_出料气缸2动点()
        {
            MotionMgr.GetInstance().WriteOut("出料气缸2原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("出料气缸2动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("出料气缸2原点", false);
            MotionMgr.GetInstance().WaitIn("出料气缸2动点", true);
        }
        private void QG_夹爪气缸1动点()
        {
            MotionMgr.GetInstance().WriteOut("夹爪气缸1原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("夹爪气缸1动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("夹爪气缸1原点", false);
            MotionMgr.GetInstance().WaitIn("夹爪气缸1动点", true);
        }
        private void QG_夹爪气缸2动点()
        {
            MotionMgr.GetInstance().WriteOut("夹爪气缸2原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("夹爪气缸2动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("夹爪气缸2原点", false);
            MotionMgr.GetInstance().WaitIn("夹爪气缸2动点", true);
        }
        private void QG_夹爪升降气缸1动点()
        {
            MotionMgr.GetInstance().WriteOut("夹爪升降气缸1原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("夹爪升降气缸1动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("夹爪升降气缸1原点", false);
            MotionMgr.GetInstance().WaitIn("夹爪升降气缸1动点", true);
        }
        private void QG_夹爪升降气缸2动点()
        {
            MotionMgr.GetInstance().WriteOut("夹爪升降气缸2原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("夹爪升降气缸2动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("夹爪升降气缸2原点", false);
            MotionMgr.GetInstance().WaitIn("夹爪升降气缸2动点", true);
        }
        private void QG_进料气缸动点()
        {
            MotionMgr.GetInstance().WriteOut("进料气缸原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("进料气缸动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("进料气缸原点", false);
            MotionMgr.GetInstance().WaitIn("进料气缸动点", true);
        }
        private void QG_出料气缸动点()
        {
            MotionMgr.GetInstance().WriteOut("出料气缸原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("出料气缸动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("出料气缸原点", false);
            MotionMgr.GetInstance().WaitIn("出料气缸动点", true);
        }
        private void QG_平台搬运气缸动点()
        {
            MotionMgr.GetInstance().WriteOut("平台搬运气缸原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("平台搬运气缸动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("平台搬运气缸原点", false);
            MotionMgr.GetInstance().WaitIn("平台搬运气缸动点", true);
        }
        private void QG_取料定位气缸动点()
        {
            MotionMgr.GetInstance().WriteOut("取料定位气缸原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("取料定位气缸动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("取料定位气缸原点", false);
            MotionMgr.GetInstance().WaitIn("取料定位气缸动点", true);
        }
        private void QG_下料上下气缸1动点()
        {
            MotionMgr.GetInstance().WriteOut("下料上下气缸1原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("下料上下气缸1动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("下料上下气缸1原点", false);
            MotionMgr.GetInstance().WaitIn("下料上下气缸1动点", true);
        }
        private void QG_下料上下气缸2动点()
        {
            MotionMgr.GetInstance().WriteOut("下料上下气缸2原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("下料上下气缸2动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("下料上下气缸2原点", false);
            MotionMgr.GetInstance().WaitIn("下料上下气缸2动点", true);
        }
        private void QG_下料上下气缸3动点()
        {
            MotionMgr.GetInstance().WriteOut("下料上下气缸3原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("下料上下气缸3动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("下料上下气缸3原点", false);
            MotionMgr.GetInstance().WaitIn("下料上下气缸3动点", true);
        }
        private void QG_下料上下气缸4动点()
        {
            MotionMgr.GetInstance().WriteOut("下料上下气缸4原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("下料上下气缸4动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("下料上下气缸4原点", false);
            MotionMgr.GetInstance().WaitIn("下料上下气缸4动点", true);
        }
        private void QG_下料上下气缸5动点()
        {
            MotionMgr.GetInstance().WriteOut("下料上下气缸5原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("下料上下气缸5动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("下料上下气缸5原点", false);
            MotionMgr.GetInstance().WaitIn("下料上下气缸5动点", true);
        }
        private void QG_磁吸升降气缸1动点()
        {
            MotionMgr.GetInstance().WriteOut("磁吸气缸1原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("磁吸气缸1动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("磁吸气缸1原点", false);
            MotionMgr.GetInstance().WaitIn("磁吸气缸1动点", true);
        }
        private void QG_磁吸升降气缸2动点()
        {
            MotionMgr.GetInstance().WriteOut("磁吸气缸2原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("磁吸气缸2动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("磁吸气缸2原点", false);
            MotionMgr.GetInstance().WaitIn("磁吸气缸2动点", true);
        }
        private void QG_磁吸升降气缸3动点()
        {
            MotionMgr.GetInstance().WriteOut("磁吸气缸3原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("磁吸气缸3动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("磁吸气缸3原点", false);
            MotionMgr.GetInstance().WaitIn("磁吸气缸3动点", true);
        }
        private void QG_磁吸升降气缸4动点()
        {
            MotionMgr.GetInstance().WriteOut("磁吸气缸4原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("磁吸气缸4动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("磁吸气缸4原点", false);
            MotionMgr.GetInstance().WaitIn("磁吸气缸4动点", true);
        }
        private void QG_磁吸升降气缸5动点()
        {
            MotionMgr.GetInstance().WriteOut("磁吸气缸5原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("磁吸气缸5动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("磁吸气缸5原点", false);
            MotionMgr.GetInstance().WaitIn("磁吸气缸5动点", true);
        }
        private void QG_OK搬运升降气缸动点()
        {
            MotionMgr.GetInstance().WriteOut("OK搬运气缸原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("OK搬运气缸动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("OK搬运气缸原点", false);
            MotionMgr.GetInstance().WaitIn("OK搬运气缸动点", true);
        }
        private void QG_上料磁吸气缸1动点()
        {
            MotionMgr.GetInstance().WriteOut("上料磁吸气缸1原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("上料磁吸气缸1动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("上料磁吸气缸1原点", false);
            MotionMgr.GetInstance().WaitIn("上料磁吸气缸1动点", true);
        }
        private void QG_上料磁吸气缸2动点()
        {
            MotionMgr.GetInstance().WriteOut("上料磁吸气缸2原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("上料磁吸气缸2动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("上料磁吸气缸2原点", false);
            MotionMgr.GetInstance().WaitIn("上料磁吸气缸2动点", true);
        }
        private void QG_上料磁吸气缸3动点()
        {
            MotionMgr.GetInstance().WriteOut("上料磁吸气缸3原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("上料磁吸气缸3动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("上料磁吸气缸3原点", false);
            MotionMgr.GetInstance().WaitIn("上料磁吸气缸3动点", true);
        }
        private void QG_上料磁吸气缸4动点()
        {
            MotionMgr.GetInstance().WriteOut("上料磁吸气缸4原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("上料磁吸气缸4动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("上料磁吸气缸4原点", false);
            MotionMgr.GetInstance().WaitIn("上料磁吸气缸4动点", true);
        }
        private void QG_上料磁吸气缸5动点()
        {
            MotionMgr.GetInstance().WriteOut("上料磁吸气缸5原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("上料磁吸气缸5动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("上料磁吸气缸5原点", false);
            MotionMgr.GetInstance().WaitIn("上料磁吸气缸5动点", true);
        }
        private void QG_入料口夹紧气缸1动点()
        {
            MotionMgr.GetInstance().WriteOut("入料口夹紧气缸1原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("入料口夹紧气缸1动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("入料口夹紧气缸1原点", false);
            MotionMgr.GetInstance().WaitIn("入料口夹紧气缸1动点", true);
        }
        private void QG_入料口平移气缸动点()
        {
            MotionMgr.GetInstance().WriteOut("入料口平移气缸原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("入料口平移气缸动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("入料口平移气缸原点", false);
            MotionMgr.GetInstance().WaitIn("入料口平移气缸动点", true);
        }
        private void QG_入料口夹紧气缸2动点()
        {
            MotionMgr.GetInstance().WriteOut("入料口夹紧气缸2原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("入料口夹紧气缸2动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("入料口夹紧气缸2原点", false);
            MotionMgr.GetInstance().WaitIn("入料口夹紧气缸2动点", true);
        }
        private void QG_入料口顶升气缸动点()
        {
            MotionMgr.GetInstance().WriteOut("入料口顶升气缸原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("入料口顶升气缸动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("入料口顶升气缸原点", false);
            MotionMgr.GetInstance().WaitIn("入料口顶升气缸动点", true);
        }
        private void QG_接料定位气缸1动点()
        {
            MotionMgr.GetInstance().WriteOut("接料定位气缸1原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("接料定位气缸1动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("接料定位气缸1原点", false);
            MotionMgr.GetInstance().WaitIn("接料定位气缸1动点", true);
        }
        private void QG_接料定位气缸2动点()
        {
            MotionMgr.GetInstance().WriteOut("接料定位气缸2原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("接料定位气缸2动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("接料定位气缸2原点", false);
            MotionMgr.GetInstance().WaitIn("接料定位气缸2动点", true);
        }
        private void QG_接料定位气缸3动点()
        {
            MotionMgr.GetInstance().WriteOut("接料定位气缸3原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("接料定位气缸3动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("接料定位气缸3原点", false);
            MotionMgr.GetInstance().WaitIn("接料定位气缸3动点", true);
        }
        private void QG_出料口气缸动点()
        {
            MotionMgr.GetInstance().WriteOut("出料口气缸原点电磁阀", false);
            MotionMgr.GetInstance().WriteOut("出料口气缸动点电磁阀", true);
            MotionMgr.GetInstance().WaitIn("出料口气缸原点", false);
            MotionMgr.GetInstance().WaitIn("出料口气缸动点", true);
        }
        #endregion

        #region 真空动作
        private void ZK_进料真空吸关()
        {
            MotionMgr.GetInstance().WriteOut("进料真空吸", false);
        }

        private void ZK_进料真空破关()
        {
            MotionMgr.GetInstance().WriteOut("进料真空破", false);
        }

        private void ZK_出料真空吸关()
        {
            MotionMgr.GetInstance().WriteOut("出料真空吸", false);
        }

        private void ZK_出料真空破关()
        {
            MotionMgr.GetInstance().WriteOut("出料真空破", false);
        }
        private void ZK_平台搬运真空吸关()
        {
            MotionMgr.GetInstance().WriteOut("平台搬运真空吸", false);
        }

        private void ZK_平台搬运真空破关()
        {
            MotionMgr.GetInstance().WriteOut("平台搬运真空破", false);
        }
        private void ZK_取料定位真空吸关()
        {
            MotionMgr.GetInstance().WriteOut("取料定位真空吸", false);
        }

        private void ZK_取料定位真空破关()
        {
            MotionMgr.GetInstance().WriteOut("取料定位真空破", false);
        }
        private void ZK_OK搬运真空吸关()
        {
            MotionMgr.GetInstance().WriteOut("OK搬运真空吸", false);
        }
        private void ZK_OK搬运真空破关()
        {
            MotionMgr.GetInstance().WriteOut("OK搬运真空破", false);
        }
        private void ZK_双工位1接料真空1吸关()
        {
            MotionMgr.GetInstance().WriteOut("双工位1接料真空1吸", false);
        }
        private void ZK_双工位1接料真空1破关()
        {
            MotionMgr.GetInstance().WriteOut("双工位1接料真空1破", false);
        }
        private void ZK_双工位1接料真空2吸关()
        {
            MotionMgr.GetInstance().WriteOut("双工位1接料真空2吸", false);
        }
        private void ZK_双工位1接料真空2破关()
        {
            MotionMgr.GetInstance().WriteOut("双工位1接料真空2破", false);
        }
        private void ZK_双工位1接料真空3吸关()
        {
            MotionMgr.GetInstance().WriteOut("双工位1接料真空3吸", false);
        }
        private void ZK_双工位1接料真空3破关()
        {
            MotionMgr.GetInstance().WriteOut("双工位1接料真空3破", false);
        }
        private void ZK_双工位1接料真空4吸关()
        {
            MotionMgr.GetInstance().WriteOut("双工位1接料真空4吸", false);
        }
        private void ZK_双工位1接料真空4破关()
        {
            MotionMgr.GetInstance().WriteOut("双工位1接料真空4破", false);
        }
        private void ZK_双工位1接料真空5吸关()
        {
            MotionMgr.GetInstance().WriteOut("双工位1接料真空5吸", false);
        }
        private void ZK_双工位1接料真空5破关()
        {
            MotionMgr.GetInstance().WriteOut("双工位1接料真空5破", false);
        }

        private void ZK_双工位2接料真空1吸关()
        {
            MotionMgr.GetInstance().WriteOut("双工位2接料真空1吸", false);
        }
        private void ZK_双工位2接料真空1破关()
        {
            MotionMgr.GetInstance().WriteOut("双工位2接料真空1破", false);
        }
        private void ZK_双工位2接料真空2吸关()
        {
            MotionMgr.GetInstance().WriteOut("双工位2接料真空2吸", false);
        }
        private void ZK_双工位2接料真空2破关()
        {
            MotionMgr.GetInstance().WriteOut("双工位2接料真空2破", false);
        }
        private void ZK_双工位2接料真空3吸关()
        {
            MotionMgr.GetInstance().WriteOut("双工位2接料真空3吸", false);
        }
        private void ZK_双工位2接料真空3破关()
        {
            MotionMgr.GetInstance().WriteOut("双工位2接料真空3破", false);
        }
        private void ZK_双工位2接料真空4吸关()
        {
            MotionMgr.GetInstance().WriteOut("双工位2接料真空4吸", false);
        }
        private void ZK_双工位2接料真空4破关()
        {
            MotionMgr.GetInstance().WriteOut("双工位2接料真空4破", false);
        }
        private void ZK_双工位2接料真空5吸关()
        {
            MotionMgr.GetInstance().WriteOut("双工位2接料真空5吸", false);
        }
        private void ZK_双工位2接料真空5破关()
        {
            MotionMgr.GetInstance().WriteOut("双工位2接料真空5破", false);
        }

        private void ZK_出料口真空1吸关()
        {
            MotionMgr.GetInstance().WriteOut("出料口真空1吸", false);
        }
        private void ZK_出料口真空1破关()
        {
            MotionMgr.GetInstance().WriteOut("出料口真空1破", false);
        }
        private void ZK_出料口真空2吸关()
        {
            MotionMgr.GetInstance().WriteOut("出料口真空2吸", false);
        }
        private void ZK_出料口真空2破关()
        {
            MotionMgr.GetInstance().WriteOut("出料口真空2破", false);
        }


        private void ZK_进料真空吸开()
        {
            MotionMgr.GetInstance().WriteOut("进料真空吸", true);
        }

        private void ZK_进料真空破开()
        {
            MotionMgr.GetInstance().WriteOut("进料真空破", true);
        }

        private void ZK_出料真空吸开()
        {
            MotionMgr.GetInstance().WriteOut("出料真空吸", true);
        }

        private void ZK_出料真空破开()
        {
            MotionMgr.GetInstance().WriteOut("出料真空破", true);
        }
        private void ZK_平台搬运真空吸开()
        {
            MotionMgr.GetInstance().WriteOut("平台搬运真空吸", true);
        }

        private void ZK_平台搬运真空破开()
        {
            MotionMgr.GetInstance().WriteOut("平台搬运真空破", true);
        }
        private void ZK_取料定位真空吸开()
        {
            MotionMgr.GetInstance().WriteOut("取料定位真空吸", true);
        }

        private void ZK_取料定位真空破开()
        {
            MotionMgr.GetInstance().WriteOut("取料定位真空破", true);
        }
        private void ZK_OK搬运真空吸开()
        {
            MotionMgr.GetInstance().WriteOut("OK搬运真空吸", true);
        }
        private void ZK_OK搬运真空破开()
        {
            MotionMgr.GetInstance().WriteOut("OK搬运真空破", true);
        }
        private void ZK_双工位1接料真空1吸开()
        {
            MotionMgr.GetInstance().WriteOut("双工位1接料真空1吸", true);
        }
        private void ZK_双工位1接料真空1开()
        {
            MotionMgr.GetInstance().WriteOut("双工位1接料真空1破", true);
        }
        private void ZK_双工位1接料真空2吸开()
        {
            MotionMgr.GetInstance().WriteOut("双工位1接料真空2吸", true);
        }
        private void ZK_双工位1接料真空2开()
        {
            MotionMgr.GetInstance().WriteOut("双工位1接料真空2破", true);
        }
        private void ZK_双工位1接料真空3吸开()
        {
            MotionMgr.GetInstance().WriteOut("双工位1接料真空3吸", true);
        }
        private void ZK_双工位1接料真空3开()
        {
            MotionMgr.GetInstance().WriteOut("双工位1接料真空3破", true);
        }
        private void ZK_双工位1接料真空4吸开()
        {
            MotionMgr.GetInstance().WriteOut("双工位1接料真空4吸", true);
        }
        private void ZK_双工位1接料真空4破开()
        {
            MotionMgr.GetInstance().WriteOut("双工位1接料真空4破", true);
        }
        private void ZK_双工位1接料真空5吸开()
        {
            MotionMgr.GetInstance().WriteOut("双工位1接料真空5吸", true);
        }
        private void ZK_双工位1接料真空5破开()
        {
            MotionMgr.GetInstance().WriteOut("双工位1接料真空5破", true);
        }

        private void ZK_双工位2接料真空1吸开()
        {
            MotionMgr.GetInstance().WriteOut("双工位2接料真空1吸", true);
        }
        private void ZK_双工位2接料真空1开()
        {
            MotionMgr.GetInstance().WriteOut("双工位2接料真空1破", true);
        }
        private void ZK_双工位2接料真空2吸开()
        {
            MotionMgr.GetInstance().WriteOut("双工位2接料真空2吸", true);
        }
        private void ZK_双工位2接料真空2开()
        {
            MotionMgr.GetInstance().WriteOut("双工位2接料真空2破", true);
        }
        private void ZK_双工位2接料真空3吸开()
        {
            MotionMgr.GetInstance().WriteOut("双工位2接料真空3吸", true);
        }
        private void ZK_双工位2接料真空3开()
        {
            MotionMgr.GetInstance().WriteOut("双工位2接料真空3破", true);
        }
        private void ZK_双工位2接料真空4吸开()
        {
            MotionMgr.GetInstance().WriteOut("双工位2接料真空4吸", true);
        }
        private void ZK_双工位2接料真空4破开()
        {
            MotionMgr.GetInstance().WriteOut("双工位2接料真空4破", true);
        }
        private void ZK_双工位2接料真空5吸开()
        {
            MotionMgr.GetInstance().WriteOut("双工位2接料真空5吸", true);
        }
        private void ZK_双工位2接料真空5破开()
        {
            MotionMgr.GetInstance().WriteOut("双工位2接料真空5破", true);
        }
        private void ZK_出料口真空1吸开()
        {
            MotionMgr.GetInstance().WriteOut("出料口真空1吸", true);
        }
        private void ZK_出料口真空1破开()
        {
            MotionMgr.GetInstance().WriteOut("出料口真空1破", true);
        }
        private void ZK_出料口真空2吸开()
        {
            MotionMgr.GetInstance().WriteOut("出料口真空2吸", true);
        }
        private void ZK_出料口真空2破开()
        {
            MotionMgr.GetInstance().WriteOut("出料口真空2破", true);
        }
        private void ZK_出料口真空3吸开()
        {
            MotionMgr.GetInstance().WriteOut("出料口真空3吸", true);
        }
        private void ZK_出料口真空4吸开()
        {
            MotionMgr.GetInstance().WriteOut("出料口真空4吸", true);
        }
        private void ZK_出料口真空5吸开()
        {
            MotionMgr.GetInstance().WriteOut("出料口真空5吸", true);
        }
        private void ZK_出料口真空3吸关()
        {
            MotionMgr.GetInstance().WriteOut("出料口真空3吸", false);
        }
        private void ZK_出料口真空4吸关()
        {
            MotionMgr.GetInstance().WriteOut("出料口真空4吸", false);
        }
        private void ZK_出料口真空5吸开关()
        {
            MotionMgr.GetInstance().WriteOut("出料口真空5吸", false);
        }
        private void ZK_出料口真空345破开()
        {
            MotionMgr.GetInstance().WriteOut("出料口真空345破", true);
        }
        private void ZK_出料口真空345破关()
        {
            MotionMgr.GetInstance().WriteOut("出料口真空345破", false);
        }
        #endregion

        private void gy_相机光源关()
        {
            MotionMgr.GetInstance().WriteOut("相机光源", false);
        }
        private void gy_相机光源开()
        {
            MotionMgr.GetInstance().WriteOut("相机光源", true);
        }
    }
}
